.class Lcom/tendcloud/tenddata/eb;
.super Ljava/lang/Object;


# static fields
.field private static final c:[Ljava/lang/Class;

.field private static final d:Ljava/util/List;


# instance fields
.field private final a:Lcom/tendcloud/tenddata/ef;

.field private final b:Lcom/tendcloud/tenddata/ej$g;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Class;

    sput-object v0, Lcom/tendcloud/tenddata/eb;->c:[Ljava/lang/Class;

    invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;

    move-result-object v0

    sput-object v0, Lcom/tendcloud/tenddata/eb;->d:Ljava/util/List;

    return-void
.end method

.method constructor <init>(Lcom/tendcloud/tenddata/ef;Lcom/tendcloud/tenddata/ej$g;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/tendcloud/tenddata/eb;->a:Lcom/tendcloud/tenddata/ef;

    iput-object p2, p0, Lcom/tendcloud/tenddata/eb;->b:Lcom/tendcloud/tenddata/ej$g;

    return-void
.end method

.method private a(Ljava/lang/Class;Lorg/json/JSONObject;)Lcom/tendcloud/tenddata/eb$b;
    .locals 7

    const/4 v6, 0x0

    :try_start_0
    const-string v0, "name"

    invoke-virtual {p2, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const-string v0, "get"

    invoke-virtual {p2, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string v0, "get"

    invoke-virtual {p2, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "selector"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v3, "result"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    const-string v3, "type"

    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    new-instance v4, Lcom/tendcloud/tenddata/ee;

    sget-object v3, Lcom/tendcloud/tenddata/eb;->c:[Ljava/lang/Class;

    invoke-direct {v4, p1, v1, v3, v0}, Lcom/tendcloud/tenddata/ee;-><init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Class;)V

    :goto_0
    const-string v0, "set"

    invoke-virtual {p2, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "set"

    invoke-virtual {p2, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "selector"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    :goto_1
    new-instance v0, Lcom/tendcloud/tenddata/eb$b;

    move-object v1, p0

    move-object v3, p1

    invoke-direct/range {v0 .. v5}, Lcom/tendcloud/tenddata/eb$b;-><init>(Lcom/tendcloud/tenddata/eb;Ljava/lang/String;Ljava/lang/Class;Lcom/tendcloud/tenddata/ee;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :goto_2
    return-object v0

    :cond_0
    move-object v5, v6

    goto :goto_1

    :catch_0
    move-exception v0

    move-object v0, v6

    goto :goto_2

    :cond_1
    move-object v4, v6

    goto :goto_0
.end method

.method private a(ILjava/lang/String;Lcom/tendcloud/tenddata/ef;)Ljava/lang/Integer;
    .locals 3

    const/4 v0, 0x0

    const/4 v2, -0x1

    if-eqz p2, :cond_1

    invoke-virtual {p3, p2}, Lcom/tendcloud/tenddata/ef;->a(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {p3, p2}, Lcom/tendcloud/tenddata/ef;->b(Ljava/lang/String;)I

    move-result v1

    :goto_0
    if-eq v2, v1, :cond_2

    if-eq v2, p1, :cond_2

    if-eq v1, p1, :cond_2

    :cond_0
    :goto_1
    return-object v0

    :cond_1
    move v1, v2

    goto :goto_0

    :cond_2
    if-eq v2, v1, :cond_3

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    goto :goto_1

    :cond_3
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    goto :goto_1
.end method

.method private static a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method a(Lorg/json/JSONObject;)Lcom/tendcloud/tenddata/ei;
    .locals 8

    const/4 v1, 0x0

    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    :try_start_0
    const-string v0, "config"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    const-string v2, "classes"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v4

    move v2, v1

    :goto_0
    invoke-virtual {v4}, Lorg/json/JSONArray;->length()I

    move-result v0

    if-ge v2, v0, :cond_1

    invoke-virtual {v4, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v0

    const-string v5, "name"

    invoke-virtual {v0, v5}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v5

    const-string v6, "properties"

    invoke-virtual {v0, v6}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    move v0, v1

    :goto_1
    invoke-virtual {v6}, Lorg/json/JSONArray;->length()I

    move-result v7

    if-ge v0, v7, :cond_0

    invoke-virtual {v6, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    invoke-direct {p0, v5, v7}, Lcom/tendcloud/tenddata/eb;->a(Ljava/lang/Class;Lorg/json/JSONObject;)Lcom/tendcloud/tenddata/eb$b;

    move-result-object v7

    invoke-interface {v3, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_0
    add-int/lit8 v0, v2, 0x1

    move v2, v0

    goto :goto_0

    :cond_1
    new-instance v0, Lcom/tendcloud/tenddata/ei;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eb;->a:Lcom/tendcloud/tenddata/ef;

    invoke-direct {v0, v3, v1}, Lcom/tendcloud/tenddata/ei;-><init>(Ljava/util/List;Lcom/tendcloud/tenddata/ef;)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    :goto_2
    return-object v0

    :catch_0
    move-exception v0

    const/4 v0, 0x0

    goto :goto_2
.end method

.method a(Lorg/json/JSONObject;Lcom/tendcloud/tenddata/ej$f;)Lcom/tendcloud/tenddata/ej;
    .locals 4

    :try_start_0
    const-string v0, "id"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v0, "type"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v2, "path"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v2

    iget-object v3, p0, Lcom/tendcloud/tenddata/eb;->a:Lcom/tendcloud/tenddata/ef;

    invoke-virtual {p0, v2, v3}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONArray;Lcom/tendcloud/tenddata/ef;)Ljava/util/List;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v3

    if-nez v3, :cond_0

    :cond_0
    const-string v3, "click"

    invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    new-instance v0, Lcom/tendcloud/tenddata/ej$a;

    const/4 v3, 0x1

    invoke-direct {v0, v2, v3, v1, p2}, Lcom/tendcloud/tenddata/ej$a;-><init>(Ljava/util/List;ILjava/lang/String;Lcom/tendcloud/tenddata/ej$f;)V

    :goto_0
    return-object v0

    :cond_1
    const-string v3, "selected"

    invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    new-instance v0, Lcom/tendcloud/tenddata/ej$a;

    const/4 v3, 0x4

    invoke-direct {v0, v2, v3, v1, p2}, Lcom/tendcloud/tenddata/ej$a;-><init>(Ljava/util/List;ILjava/lang/String;Lcom/tendcloud/tenddata/ej$f;)V

    goto :goto_0

    :catch_0
    move-exception v0

    :cond_2
    const/4 v0, 0x0

    goto :goto_0

    :cond_3
    const-string v3, "text_changed"

    invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_4

    new-instance v0, Lcom/tendcloud/tenddata/ej$b;

    invoke-direct {v0, v2, v1, p2}, Lcom/tendcloud/tenddata/ej$b;-><init>(Ljava/util/List;Ljava/lang/String;Lcom/tendcloud/tenddata/ej$f;)V

    goto :goto_0

    :cond_4
    const-string v3, "detected"

    invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    new-instance v0, Lcom/tendcloud/tenddata/ej$i;

    invoke-direct {v0, v2, v1, p2}, Lcom/tendcloud/tenddata/ej$i;-><init>(Ljava/util/List;Ljava/lang/String;Lcom/tendcloud/tenddata/ej$f;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0
.end method

.method a(Lorg/json/JSONArray;Lcom/tendcloud/tenddata/ef;)Ljava/util/List;
    .locals 12

    const/4 v8, 0x0

    const/4 v11, -0x1

    new-instance v9, Ljava/util/ArrayList;

    invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V

    move v7, v8

    :goto_0
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I

    move-result v0

    if-ge v7, v0, :cond_3

    invoke-virtual {p1, v7}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "prefix"

    invoke-static {v0, v1}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "class"

    invoke-static {v0, v2}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const-string v3, "index"

    invoke-virtual {v0, v3, v11}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v3

    const-string v4, "description"

    invoke-static {v0, v4}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v4, "id"

    invoke-virtual {v0, v4, v11}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v4

    const-string v6, "id_name"

    invoke-static {v0, v6}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    const-string v6, "tag"

    invoke-static {v0, v6}, Lcom/tendcloud/tenddata/eb;->a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v0, "shortest"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v1, 0x1

    :goto_1
    invoke-direct {p0, v4, v10, p2}, Lcom/tendcloud/tenddata/eb;->a(ILjava/lang/String;Lcom/tendcloud/tenddata/ef;)Ljava/lang/Integer;

    move-result-object v0

    if-nez v0, :cond_2

    sget-object v0, Lcom/tendcloud/tenddata/eb;->d:Ljava/util/List;

    :goto_2
    return-object v0

    :cond_0
    if-nez v1, :cond_1

    move v1, v8

    goto :goto_1

    :cond_1
    sget-object v0, Lcom/tendcloud/tenddata/eb;->d:Ljava/util/List;

    goto :goto_2

    :cond_2
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v4

    new-instance v0, Lcom/tendcloud/tenddata/eh$c;

    invoke-direct/range {v0 .. v6}, Lcom/tendcloud/tenddata/eh$c;-><init>(ILjava/lang/String;IILjava/lang/String;Ljava/lang/String;)V

    invoke-interface {v9, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v0, v7, 0x1

    move v7, v0

    goto :goto_0

    :cond_3
    move-object v0, v9

    goto :goto_2
.end method
